package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Scanner;

public class IODemo10 {
    public static void main(String[] args) throws IOException {
        try (InputStream inputStream = Files.newInputStream(Paths.get("./test.txt"));
             Scanner scanner = new Scanner(inputStream)) {
            while (scanner.hasNext()) {
                String str = scanner.next();
                System.out.println(str);
            }
        }
    }
}
